POOL32A 000000 |
rt |
rs |
ac |
MAQ_S.W.PHR 00101001 |
POOL32Axf 111100 |
POOL32A 000000 |
rt |
rs |
ac |
MAQ_SA.W.PHR 10101001 |
POOL32Axf 111100 |
6 |
5 |
5 |
2 |
8 |
6 |
SPECIAL3 011111 |
rs |
rt |
0 000 |
ac |
MAQ_S.W.PHR 10110 |
DPA.W.PH 110000 |
SPECIAL3 011111 |
rs |
rt |
0 000 |
ac |
MAQ_SA.W.PHR 10010 |
DPA.W.PH 110000 |
6 |
5 |
5 |
3 |
2 |
5 |
6 |
MAQ_S[A].W.PHR |
Multiply with Accumulate Single Vector Fractional Halfword Element | |
MAQ_S.W.PHR ac, rs, rt |
microMIPSDSP |
Multiply with Accumulate Single Vector Fractional Halfword Element |
MAQ_SA.W.PHR ac, rs, rt |
microMIPSDSP |
Multiply with Accumulate Single Vector Fractional Halfword Element |
Multiply with Accumulate Single Vector Fractional Halfword Element
To multiply one pair of elements from two vectors of fractional halfword values using full-sized intermediate products and accumulate the result into the specified 64-bit accumulator, with optional saturating accumulation.
ac = sat32(ac + sat32(rs15..0 * rt15..0))
The right-most Q15 fractiona l halfword values from each of the registers rt and rs are multiplied together and the product left-shifted by one bit position to generate a Q31 fractional format intermediate result. If both multiplicands are equal to -1.0 in Q15 fractional format (0x8000 hexadecimal), the intermediate result is saturated to the maximum positive Q31 fractional value (0x7FFFFFFF hexadecimal). The intermediate result is then sign-extended and accumulated into accumulator ac to generate a 64-bit Q32.31 fractional format result.
In the saturating accumulation variant of this instruction, if the accumulation of the intermediate product with the accumulator results in a value that cannot be represented as a Q31 fractional format value, the accumulator is saturated to either the maximum positive Q31 fractional format value (0x7FFFFFFF hexadecimal) or the minimum negative Q31 fractional format value (0x80000000), sign-extended to 64 bits.
The value of ac can range from 0 to 3; a value of 0 refers to the original HI/LO register pair of the MIPS64 architecture.
If overflow or saturation occurs, a 1 is w ritten to one of bits 16 through 19 of the DSPControl register, within the
ouflag field. The value of ac determines which of these bits is set: bit 16 corresponds to ac0, bit 17 to ac1, bit 18 to ac2, and bit 19 to ac3.
No data-dependent exceptions are possible.
The operands must be values in the specified format. If they are not, the result is UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.
MAQ_S.W.PHR: tempA31..0 = multiplyQ15Q15( ac, GPR[rs]15..0, GPR[rt]15..0 ) tempB63..0 = ( HI[ac]31..0 || LO[ac]31..0 ) + ( (tempA31)32 || tempA31..0 ) ( HI[ac]63..0 || LO[ac]63..0 ) = (tempB63)32 || tempB63..32 || (tempB31)32 || tempB31..0 MAQ_SA.W.PHR: tempA31..0 = multiplyQ15Q15( ac, GPR[rs]15..0, GPR[rt]15..0 ) tempA31..0 = sat32AccumulateQ31( ac, temp ) tempB63..0 = (tempA31)32 || tempA31..0 ( HI[ac]63..0 || LO[ac]63..0 ) = (tempB63)32 || tempB63..32 || (tempB31)32 || tempB31..0
Reserved Instruction, DSP Disabled
The MAQ_SA version of the instruction is useful for compliance with some ITU speech processing codecs that require a 32-bit saturation after every multiply-accumulate operation.